<include file="Inc/header" />
<div class="margin10px searchbox">
	<form action="<?php echo U('admin/acl/admin_list');?>" method="get">
		分组：<?php echo $groups;?>&nbsp;&nbsp;&nbsp;&nbsp;
		状态：<select name="st"><option value="">全部</option><option value="1" <?php if($param['st']=='1'){echo 'selected';}?>>正常</option><option value="0" <?php if($param['st']=='0'){echo 'selected';}?>>禁用</option></select>&nbsp;&nbsp;&nbsp;
		用户名：<input type="text" name="admin_name_like" style=" width:80px;" value="<?php echo $param['admin_name_like'];?>" />
		&nbsp;&nbsp;&nbsp;<input type="submit" name="so" class="button" value="搜索" />
	</form>
</div>
<div class="margin10px">
	<table class="mytable">
		<tr>
			<th width="40">ID</th>
			<th>用户名</th>
            <th width="100">分组</th>
			<th width="40">状态</th>
			<th width="40">操作</th>
		</tr>
		<?php if($list){foreach($list as $v){?>
		<tr>
			<td class="tdf"><?php echo $v['admin_id'];?></td>
			<td><?php echo $v['admin_name'];?></td>
            <td><?php echo $v['group_name'];?></td>
			<td><span class="cursorpointer" onclick="adminStatus(<?php echo $v['admin_id'];?>, <?php echo (1-$v['st']);?>)"><?php if($v['st']==1){echo '<font color="green">正常</font>';}else{echo '<font color="red">禁用</font>';}?></span></td>
			<td>
            	<!--<a href="<?php echo U('admin/acl/admin_del', array('admin_id'=>$v['admin_id']));?>" onclick="javascript:return confirm('提示：您确定要删除吗？')">删除</a> / -->
                <a href="<?php echo U('admin/acl/admin_edit', array('admin_id'=>$v['admin_id']));?>">修改</a>
            </td>
		</tr>
		<?php }}else{?>
		<tr>
			<td colspan="6">没有数据</td>
		</tr>
		<?php }?>
	</table>
    <div style="height:10px;">&nbsp;</div>
	<?php echo $pager;?>
</div>
<script type="text/javascript">
function adminStatus(admin_id, st){
	$.ajax({
		url:'<?php echo U('admin/acl/ajax_admin_st');?>',
		data:({'admin_id':admin_id, 'st':st}),
		type:'post',
		success:function(msg){
			if(msg == 'ok'){
				alert('操作成功');
				location.reload();
			}else{
				alert(msg);
			}
		},
		error:function(){
			alert('网络繁忙，请稍后重试');
		}
	})
}
</script>
<include file="Inc/footer" />